<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="javax.naming.*"%>
<%@ taglib uri="/WEB-INF/holly-unicom-logic.tld" prefix="unicom-logic"%>

<%@ page contentType="text/html; charset=gb2312"%>

<script language="JavaScript" src="images/tree.js"></script>

<PRE>

<%

net.sf.hibernate.Session hs = null;
try {
	net.sf.hibernate.SessionFactory hsf =
    (net.sf.hibernate.SessionFactory)
    com.hollycrm.springframework.factory.DefaultBeanFactory.getBean("sessionFactory");
    hs = hsf.openSession();

    out.println(hs.find("from SheetCategory"));

    org.springframework.orm.hibernate.HibernateTemplate ht =
    (org.springframework.orm.hibernate.HibernateTemplate)
    com.hollycrm.springframework.factory.DefaultBeanFactory.getBean("hibernateTemplate");
	List treeList = com.hollycrm.unicom.usersupport.hibernate.OracleHibernateUserSupportHelper.getDepartmentTreeList(hs, ht, "0");
    for (Iterator iter = treeList.iterator(); iter.hasNext();) {
        com.hollycrm.unicom.usersupport.DepartmentTreeViewObject dtvo =
        	(com.hollycrm.unicom.usersupport.DepartmentTreeViewObject) iter.next();
		out.println("id: " + dtvo.getId() + " name: " + dtvo.getName() + " type: " + dtvo.getType() + " level: " + dtvo.getLevel());
    }
    request.setAttribute("treeList", treeList);

}
catch (Exception e) {
	e.printStackTrace(response.getWriter());
}
finally {
//    hs.close();
}


%>
</pre>
<unicom-logic:treeview title="" href="#" param="treeId" imgfold="images/tree_plus.gif" imgxian="images/xian.gif" name="treeList"  onclick="doClick()" ondblclick="doDblclick()" onmousedown="doMousedown()" scope="request"/>
